# _*_coding:utf-8 _*_
__author__ = 'fangzhihui'
__date__ = '2017/5/6 0006  12:54'

#类的方法也是类的属性


class Test(object):
    def test(self):
        pass

a  = Test()
a.test = '123'
print  a.test



class Programer(object):
    hobby = "play computer"

    #类的方法定义
    def __init__(self,name, age, weight):
        self.name = name
        self.age = age
        self.__weight = weight

    @classmethod
    def get_hobby(cls):
        return cls.hobby

    @classmethod
    def get_weight(self):
         return  self.__weight

    def self_introduction(self):

        print 'My Name is %s \nI am %s years old\n'  %(self.name,self.age)

    def add(self):
        pass

    def _minus(self):
        pass

    def __multiply(self):
        pass


#类的继承BackengProgramer  tp Programer
class BackendProgramer(Programer):
    def __init__(self,name, age, weight,language):
         super(BackendProgramer,self).__init__(name,age,weight)
         self.language = language


if __name__ == '__main__':
    programer = BackendProgramer('fangzhihui',25, 80,'Python')
    print  dir(programer)
    print programer.__dict__
    print type(programer)
    print isinstance(programer,Programer)



